<template>
    <el-dialog
            title="任务评论"
            :visible.sync="dialogVisible"
            :append-to-body="appendToBody"
    >
        <Table
                ref="commentTable"
                :columns="columns"
                :data="$baseURL.workflow +  '/workflow/comment/comment/ListPage'"
                :query-params="queryParams"
                :show-toolbar="false"
        ></Table>
        <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
  </span>
    </el-dialog>
</template>

<script>
    import Table from '../../../../common-util/src/components/page/Table.vue'

    export default {
        name: "CommentDialog",
        components: {
            Table
        },
        props:{
            queryParams:{
                type: Object
            },
            appendToBody:{
                type: Boolean
            }
        },

        data (){
            return {
                dialogVisible: false,
                columns:[
                    {
                        type: 'index',
                        label:'序号'
                    },
                    {
                        prop: 'fullMessage',
                        label:'评论内容',
                        formatter:(row, column, cellValue)=>{
                            let r = cellValue
                            if(!r){
                                r = row.message
                            }
                            if(!r){
                                r = '-'
                            }
                            return r
                        }
                    },
                    {
                        prop: 'userNickname',
                        label:'评论人'
                    },
                    {
                        prop: 'timeTxt',
                        label:'评论时间'
                    },
                    {
                        prop: 'taskName',
                        label:'任务名称'
                    },
                ]
            }
        },
        methods:{
            show(){
                this.dialogVisible = true
            },
            getTableRef() {
                return this.$refs.commentTable
            }
        }
    }
</script>

<style scoped>

</style>